<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    $router->resource('users', 'UserController');
    $router->resource('wechat-users', 'WechatUserController');

    $router->group([
        'prefix' => 'cont'
    ],function (Router $router) {
        $router->resource('subject', 'CmSubjectController');
        $router->resource('type', 'CmTypeController');
        $router->resource('label', 'CmLabelController');
        $router->resource('question', 'CmQuestionController');
    });

    // api
    $router->group([
        'prefix' => 'api'
    ],function (Router $router) {
        // 获取课程类型
        $router->get('cm_type', 'CmTypeController@selectCmType');
    });
});
